package src.com.servlet;

import src.com.service.MyService;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class GetPageNum extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setCharacterEncoding("utf-8");
        resp.setContentType("text/html");
        MyService myService = new MyService();
        int pageNum = myService.getPageNum();
        PrintWriter out = resp.getWriter();
        out.print(pageNum);
        out.flush();
        out.close();
    }
}
